home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_autotorch.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  94 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_AutoTorch.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     entered
  15.     
  16.     thing       torch
  17.     thing       flame
  18.     
  19.     sector      liteSect
  20.     sector      sec_NoBurn
  21.     sector      sec_Burn
  22.     
  23.     sound       burning=gen_torch_burnin_c.wav      local
  24.     sound       lite=gen_torchlitet_c.wav           local
  25.     
  26.     flex        lituptime=0.5
  27.     flex        maxradius=0.35
  28.     
  29.     vector      normLight       local
  30.     vector      redLight        local
  31.     
  32.     int         lit=0           local
  33.     int         burn_Chnl       local
  34.     int         burn_On         local
  35.     int         red
  36.     
  37. end
  38.  
  39. # ========================================================================================
  40.  
  41. code
  42.  
  43. startup:
  44.  
  45.     normLight = VectorSet(0.87, 0.55, 0.06);
  46.     redLight = VectorSet(0.87, 0.05, 0.05);
  47.     SetThingFlags(flame, 0x10);
  48.     return;
  49.  
  50. # ========================================================================================
  51.  
  52. entered:
  53.  
  54.     if((GetSenderRef() == liteSect) && (lit == 0))
  55.     {
  56.         Sleep(Rand() + 0.1);
  57.         lit = 1;
  58.         ClearThingFlags(flame, 0x10);
  59.         PlaySoundThing(lite, torch, 1.0, 10, 25, 0x0);
  60.         burn_Chnl = PlaySoundThing(burning, torch, 1.0, 10, 25, 0x0001);
  61.                                          
  62.         if(red == 0)
  63.         {
  64.             SetThingLight(flame, normLight, maxradius, lituptime);
  65.             SetThingLight(torch, normLight, 0.001, lituptime);
  66.         }
  67.         
  68.         else
  69.         {
  70.             SetThingLight(flame, redLight, maxradius, lituptime);
  71.             SetThingLight(torch, redLight, 0.001, lituptime);
  72.         }
  73.     }
  74.     
  75.     # turn OFF burn sfx
  76.     if((GetSenderRef() == sec_NoBurn) && (lit == 1) && (burn_On == 1))
  77.     {
  78.         burn_On = 0;
  79.         StopSound(burn_Chnl, 0.5);
  80.     }
  81.     
  82.     # turn ON burn sfx
  83.     if((GetSenderRef() == sec_Burn) && (lit == 1) && (burn_On == 0))
  84.     {
  85.         burn_On = 1;
  86.         burn_Chnl = PlaySoundThing(burning, torch, 1.0, 10, 25, 0x0001);
  87.     } 
  88.     
  89.     return;
  90.         
  91. # ========================================================================================
  92.         
  93. end
  94.